Feature: Add label methods, properties to Episodes#868
Feature: Add label methods, properties to Episodes#868glensc wants to merge 2 commits intopushingkarmaorg:masterfrom
Conversation
|
Labels were not added to episodes because you can't add them in the Plex UI. There may be unexpected issues/bugs with sharing label restrictions because Plex isn't designed to support episodes. |
|
so as far as i can tell from plexapi.server import PlexServer
from plexapi import utils
PLEX_URL = ""
PLEX_TOKEN = ""
PLEX_LIBRARY = ""
EPISODE_LABEL = ""
COLLECTION_NAME = ""
ps = PlexServer(PLEX_URL, PLEX_TOKEN, timeout=600)
lib = next((s for s in ps.library.sections() if s.title == PLEX_LIBRARY), None)
if lib:
key = None
for choice in lib.listFilterChoices("label"):
if choice.title == EPISODE_LABEL:
key = choice.key
break
if key:
args = {
"type": 4,
"title": COLLECTION_NAME,
"smart": 1,
"sectionId": lib.key,
"uri": f"server://{ps.machineIdentifier}/com.plexapp.plugins.library/library/sections/{lib.key}/all?type=4&episode.label={key}"
}
ps.query(f"/library/collections{utils.joinArgs(args)}", method=ps._session.post) |
|
Add test. https://github.com/pkkid/python-plexapi/blob/master/tests/test_video.py#L1151 test_mixins.edit_label(episode) |
|
Test added 874d6e2 |
|
Are the errors really from this PR? |
|
EDIT: nevermind, the last CI job has passed OK: |
|
Combined into PR #872 so it's all in one PR. |


Description
Seems
LabelMixinwas added toAlbum,Collection,Show, andMovie, but left out ofEpisode.My testing with
1.24.3.5033-757abe6b4shows that Episodes can also have labels.Type of change
Please delete options that are not relevant.
Checklist: